package com.chu.service.impl;

import com.chu.entity.ResumeManage;
import com.chu.mapper.ResumeManageMapper;
import com.chu.service.ResumeManageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ResumeManageServiceImpl implements ResumeManageService {

    @Autowired
    private ResumeManageMapper manageMapper;

    @Override
    public PageInfo<ResumeManage> findAllResumeManage(int page,int size,String username, String roleName,
                                                      String workExp, String registerDate) {

        PageHelper.startPage(page,size);
        Map map = new HashMap();
        map.put("username",username);
        map.put("roleName",roleName);
        map.put("workExp",workExp);
        map.put("registerDate",registerDate);
        List<ResumeManage> manageList = manageMapper.findAllResumeManage(map);
        PageInfo pageInfo = new PageInfo(manageList);
        return pageInfo;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return manageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(ResumeManage record) {
        return 0;
    }

    @Override
    public int insertSelective(ResumeManage record) {
        return manageMapper.insertSelective(record);
    }

    @Override
    public ResumeManage selectByPrimaryKey(Integer id) {
        return manageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(ResumeManage record) {
        return manageMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(ResumeManage record) {
        return 0;
    }
}
